package com.ruoyi.order.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.StatisticCustomersMapper;
import com.ruoyi.order.domain.StatisticCustomers;
import com.ruoyi.order.service.IStatisticCustomersService;

/**
 * VIEWService业务层处理
 *
 * @author ruoyi
 * @date 2021-07-08
 */
@Service
public class StatisticCustomersServiceImpl implements IStatisticCustomersService
{
    @Autowired
    private StatisticCustomersMapper statisticCustomersMapper;

    /**
     * 查询VIEW
     *
     * @param companyName VIEWID
     * @return VIEW
     */
    @Override
    public StatisticCustomers selectStatisticCustomersById(String companyName)
    {
        return statisticCustomersMapper.selectStatisticCustomersById(companyName);
    }

    /**
     * 查询VIEW列表
     *
     * @param statisticCustomers VIEW
     * @return VIEW
     */
    @Override
    public List<StatisticCustomers> selectStatisticCustomersList(StatisticCustomers statisticCustomers, SysUser user)
    {

                return statisticCustomersMapper.selectStatisticCustomersList(statisticCustomers);

    }

    @Override
    public List<StatisticCustomers> selectStatisticCustomersListWithoutPrices(StatisticCustomers statisticCustomers, SysUser user)
    {

        return statisticCustomersMapper.selectStatisticCustomersListWithoutPrices(user.getUserId());
    }

    /**
     * 新增VIEW
     *
     * @param statisticCustomers VIEW
     * @return 结果
     */
    @Override
    public int insertStatisticCustomers(StatisticCustomers statisticCustomers)
    {
        return statisticCustomersMapper.insertStatisticCustomers(statisticCustomers);
    }

    /**
     * 修改VIEW
     *
     * @param statisticCustomers VIEW
     * @return 结果
     */
    @Override
    public int updateStatisticCustomers(StatisticCustomers statisticCustomers)
    {
        return statisticCustomersMapper.updateStatisticCustomers(statisticCustomers);
    }

    /**
     * 批量删除VIEW
     *
     * @param companyNames 需要删除的VIEWID
     * @return 结果
     */
    @Override
    public int deleteStatisticCustomersByIds(String[] companyNames)
    {
        return statisticCustomersMapper.deleteStatisticCustomersByIds(companyNames);
    }

    /**
     * 删除VIEW信息
     *
     * @param companyName VIEWID
     * @return 结果
     */
    @Override
    public int deleteStatisticCustomersById(String companyName)
    {
        return statisticCustomersMapper.deleteStatisticCustomersById(companyName);
    }
}
